package space.xxhui.utils

import java.text.SimpleDateFormat
import java.util.Date

/**
 * @author HitvzByHui
 *         date 2021-09-12
 */
object DateUtils extends Serializable {

  val FORMAT_DATE = "yyyy-MM-dd"

  def timeStamp2Date(timeStamp: Long, format: String): String = {
    val dateFormat = new SimpleDateFormat(format)
    dateFormat.format(new Date(timeStamp));
  }

  def main(args: Array[String]): Unit = {
    println(timeStamp2Date(System.currentTimeMillis(),FORMAT_DATE))
  }

}
